package com.example.administrator.aidlapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.example.administrator.aidlapplication.binder.BinderClient;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    //TODO 3界面调用
BinderClient mBinderClient=null;
    void ConnectService(){
        Intent it=new Intent("aidl.demo");
        //android 5.0以后调用aidl服务必须显示指定包名
        it.setPackage("com.example.administrator.aidlapplication");
        mBinderClient=new BinderClient();
        bindService(it,mBinderClient,BIND_AUTO_CREATE);
    }
}
